import { defineComponent, h } from 'vue';
export default defineComponent({
	props: {
		vNode: [Array, String, Object, Number],
	},
	setup(props) {
		const render = () => {
			if (typeof props.vNode === 'object') {
				// 虚拟节点直接返回
				return props.vNode;
			} else if (typeof props.vNode === 'string') {
				return h('div', { innerHTML: props.vNode });
			} else {
				// 否则创建虚拟节点
				return h('div', props.vNode);
			}
		};
		return render;
	},
});
